﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace AutomationTools.Procedimentos.SimulacaoUso.Aplicativo
{
    public class ExecutarBatchCommands : ExecutarBatch
    {
        string commands;
        public ExecutarBatchCommands(string commands)
        {
            base.fileName = string.Format("temp_{0}.bat", Guid.NewGuid().ToString());
            this.commands = commands;
        }

        public override object Executar(IContexto contexto)
        {
            File.WriteAllText(base.fileName, commands);
            var ret = base.Executar(contexto);
            File.Delete(base.fileName);

            return ret;
        }

    }
}
